﻿using System;
using System.Collections;
using System.Web.UI.WebControls;

using FrameWork.Components;

namespace FrameWork.web.Manager.Module.Tousu
{
    public partial class SelectLingDao : System.Web.UI.Page
    {
        Int32 IDX = (Int32)Common.sink("IDX", MethodType.Get, 10, 0, DataType.Int);
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindLingDao();
            }
        }

        private void BindLingDao()
        {
            int rInt = 0;
            QueryParam qp = new QueryParam();
            qp.Where = " Where R_RoleID=1";
            ArrayList lst = BusinessFacade.sys_UserRolesList(qp, out rInt);
            foreach (sys_UserRolesTable var in lst)
            {
                string userCName = BusinessFacade.get_table_fileds("sys_User", "U_CName", "UserID", var.R_UserID.ToString());

                ListItem myListItem = new ListItem(userCName, var.R_UserID.ToString());
                this.DropDownList1.Items.Add(myListItem);

            } 
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            BusinessFacade.Update_Table_Fileds("T_Tousu", "zhuangtai='领导审批'",string.Format("ID={0}",IDX.ToString()));
            BusinessFacade.Update_Table_Fileds("T_Tousu", string.Format("toLingDao='{0}'",DropDownList1.SelectedValue), string.Format("ID={0}", IDX.ToString()));

            this.Response.Write("<script>");
            this.Response.Write("{top.opener =null;top.close();}");
            this.Response.Write("</script>");
        }
    }
}